#include "stdafx.h"
#include "SDLGameWindow.h"

namespace AGE
{
	SDLGameWindow::SDLGameWindow()
	{
	}

	SDLGameWindow::~SDLGameWindow()
	{
	}


	bool SDLGameWindow::Init()
	{
		bool fSuccess = false;

		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);

		m_screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL );

		glEnable( GL_TEXTURE_2D );
 
		glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
 
		glViewport( 0, 0, 640, 480 );
 
		glClear( GL_COLOR_BUFFER_BIT );
 
		glMatrixMode( GL_PROJECTION );
		glLoadIdentity();
 
		glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f);
 
		glMatrixMode( GL_MODELVIEW );
		glLoadIdentity();

		fSuccess = true;

		return fSuccess;
	}
}
